﻿CREATE PROCEDURE [dbo].[yaf_bannedip_save](
                @ID      INT  = NULL,
                @BoardID INT,
                @Mask    NVARCHAR(15))
AS
    BEGIN
        IF @ID IS NULL 
            OR @ID = 0
        BEGIN
            INSERT INTO yaf_BannedIP
                       (BoardID,
                        Mask,
                        Since)
            VALUES     (@BoardID,
                        @Mask,
                        Getdate())
        END
        ELSE
        BEGIN
            UPDATE yaf_BannedIP
            SET    Mask = @Mask
            WHERE  ID = @ID
        END
    END


